package com.ayitubie.refuelweb.controller;

import com.alibaba.fastjson.JSON;
import com.ayitubie.refuelweb.entity.WebError;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ayitubie.refuelweb.service.testMybatisG;
import com.ayitubie.refuelweb.entity.test;
import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/test")
public class testMybatisGCtl {
    @Autowired
    private testMybatisG testMybatisG;
    @GetMapping("mybatis/g")
    public List<test> getTestInfo() throws Exception {
        return testMybatisG.getTestInfo();
    }

    @PostMapping("webError")
    public void getWebError(@RequestBody Map<String,Object> model) throws Exception{
        String authInfo = JSON.toJSONString(model.get("authInfo"));
        String breadcrumb = JSON.toJSONString(model.get("breadcrumb"));
        WebError data = JSON.parseObject(JSON.toJSONString(model.get("data")), WebError.class);
        System.out.println(data);
    }
}
